package com.jwell.panrank.model

import com.jwell.driverapp.tools.BaseSubscriber
import com.jwell.panrank.application.App
import com.jwell.panrank.contract.CaptureContract
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * Created by 76577 on 2018/4/13.
 * 二维码扫描结果上传
 */
class CaptureModel : CaptureContract.Model, BaseModel() {
    override fun unloading(id: String, baseSubscriber: BaseSubscriber) {
        if (App.DEBUG) println("二维码扫描结果上传id")
        val map = mutableMapOf("id" to id)
        getApiStore().unloading(map)
                .subscribeOn(Schedulers.io())
                .unsubscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(baseSubscriber)
    }
}